home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d1 / dostech.arc / CHAP2 < prev    next >
Text File  |  1989-02-04  |  35KB  |  714 lines

  1. CHAPTER 2
  2.  
  3.  Programming Technical Reference - IBM
  4.  Copyright 1988, Dave Williams
  5.  
  6.  CPU Port Assignments, System Memory Map, BIOS Data Area, Interrupts 00h to 09h
  7.  
  8.  
  9.                         SYSTEM MEMORY MAP - OVERALL
  10.  
  11.  The IBM PC handles its address space in 64k segments, divided into 16k
  12. fractions and then further as nescessary.
  13.  
  14. start   start  end
  15. addr.   addr.  addr.              usage
  16. (dec)      (hex)
  17.  
  18. 00000 **** 640k *************** system data, drivers....
  19.                         0000:0000  hardware interrupt vectors
  20.                         0000:0040  BIOS interrupt vectors
  21. 0k      start of RAM |  0000:0080  DOS interrupt vector table
  22. 16k     00000-03FFF  |  0000:0300  Stack area during POST and bootstrap routine
  23. 32k     04000-07FFF  |  0000:0400  BIOS Data Area 
  24. 48k     08000-0BFFF  |  0000:04F0  Intra-Application Communications Area
  25.                      |
  26. 64k     10000-13FFF  |  0000:0500  DOS reserved communication area
  27. 80k     14000-17FFF  |  xxxx:0000  IO.SYS - DOS interface to ROM I/O routines
  28. 96k     18000-1BFFF  |  xxxx:0000  MSDOS.SYS - DOS interrupt handlers, service
  29. 112k    1C000-1FFFF  |             routines (int 21 functions)
  30.                      |
  31. 128k    20000-23FFF  |  xxxx:xxxx  DOS buffers, control areas, and installed
  32. 144k    24000-27FFF  |             device drivers.
  33. 160k    28000-2BFFF  |  xxxx:0000  resident portion of COMMAND.COM, interrupt
  34. 176k    2C000-2FFFF  |             handlers for int 22h, 23h,24h, and code to
  35.                      |             reload the transient portion
  36. 192k    30000-33FFF  |  xxxx:0000  master environment block, default 64 bytes
  37. 208k    34000-37FFF  |  xxxx:0000  environment for next program
  38. 224k    38000-3BFFF  |  xxxx:0000  external commands or utilities (COM or EXE
  39. 240k    3C000-3FFFF  |             files)
  40.                      |
  41. 256k    40000-43FFF  |  ----:----  application programs
  42. 272k    44000-47FFF  |  xxxx:0000  user stack for COM files (256 bytes)
  43. 288k    48000-4BFFF  |  xxxx:0000  transient portion of COMMAND.COM
  44. 304k    4C000-4FFFF  |
  45.                      |
  46. 320k    50000-53FFF  |
  47. 336k    54000-57FFF  |
  48. 352k    58000-5BFFF  |
  49. 368k    5C000-5FFFF  |
  50.                      |
  51. 384k    60000-63FFF  |
  52. 400k    64000-67FFF  |
  53. 416k    68000-6BFFF  |
  54. 432k    6C000-6FFFF  |
  55.                      |
  56. 448k    70000-73FFF  |
  57. 464k    74000-77FFF  |
  58. 480k    78000-7BFFF  |
  59. 496k    7C000-7FFFF  |
  60.                      |
  61. 512k    80000-83FFF  |
  62. 528k    84000-87FFF  |
  63. 544k    88000-8BFFF  | original IBM PC-1 BIOS limited memory to 544k
  64. 560k    8C000-8FFFF  |
  65.                      |
  66. 576k    90000-93FFF  |
  67. 592k    94000-97FFF  |
  68. 609k    98000-9BFFF  |
  69. 624k    9C000-9FFFF  | to 640k (top of RAM address space)
  70.  
  71.  
  72. A0000 ***** 64k *************** EGA address
  73. 640k    A0000-A95B0  MCGA 320x200 256 color video buffer
  74.               AF8C0  MCGA 640x480 2 color video buffer
  75.              -A3FFF 
  76. 656k    A4000-A7FFF
  77. 672k    A8000-ABFFF
  78. 688k    AC000-AFFFF
  79.  
  80.  
  81. B0000 ***** 64k *************** mono and CGA address
  82. 704k    B0000-B3FFF  mono uses only 4k        | The PCjr and early Tandy 1000
  83. 720k    B4000-B7FFF                           | BIOSs revector direct writes to
  84. 736k    B8000-BBFFF  CGA uses entire 16k      | the B8 area to the Video Gate
  85. 756k    BC000-BFFFF                           | Array and reserved system RAM
  86.  
  87.  
  88. C0000 ***** 64k *************** expansion ROM
  89. 768k    C0000-C3FFF  16k EGA BIOS C000:001E EGA BIOS signature (the letters IBM)
  90. 784k    C4000-C5FFF
  91.         C6000-C63FF  256 bytes Professional Graphics Display communication area
  92.         C6400-C7FFF
  93. 800k    C8000-CBFFF  16k hard disk controller BIOS, drive 0 default
  94. 816k    CC000-CDFFF  8k  IBM PC Network NETBIOS
  95.         CE000-CFFFF
  96.  
  97. D0000 ***** 64k *************** expansion ROM | PCjr first ROM cartridge
  98. 832k    D0000-D7FFF  32k IBM Cluster Adapter  | address area.
  99.         DA000        voice communications     |
  100. 848k    D4000-D7FFF                           | Common expanded memory board
  101. 864k    D8000-DBFFF                           | paging area.
  102. 880k    DC000-DFFFF                           |
  103.  
  104.  
  105. E0000 ***** 64k *************** expansion ROM |    PCjr second ROM
  106. 896k    E0000-E3FFF                           |    cartridge address
  107. 912k    E4000-E7FFF                           |    area
  108. 928k    E8000-EBFFF                           |
  109. 944k    EC000-EFFFF                           |
  110.                                              
  111.  
  112. F0000 ***** 64k *************** system        |    PCjr optional ROM
  113. 960k    F0000-F3FFF  reserved by IBM          |    cartridge address
  114. 976k    F4000-                                |    area (cartridge
  115.         F6000        ROM BASIC Begins         |    BASIC)
  116. 992k    F8000-FB000                           |
  117. 1008k   FC000-FFFFF  ROM BASIC and original   |
  118.                      BIOS (Compatibility BIOS |
  119.                      in PS/2)                 |
  120. 1024k   FFFFF   end of memory (1024k) for 8088 machines
  121. F000:FFF5 BIOS release date
  122. F000:FFFE PC model identification
  123.  
  124. 384k    100000-15FFFF  80286/AT extended memory area, 1Mb motherboard
  125. 15Mb    100000-FFFFFF  80286/AT extended memory address space
  126.  
  127. 15Mb    160000-FDFFFF  Micro Channel RAM expansion (15Mb extended memory)
  128. 128k    FE0000-FFFFFF  system board ROM            (PS/2 Advanced BIOS)
  129.  
  130.  
  131.  
  132.        PC Port Assignment, Intel 8088, 80C88, 8086, 80286, 80386 CPUs
  133.  
  134. hex addr.                    Function
  135.  
  136. 0000-000F       8237 DMA controller
  137. 0010-001F       8237 DMA controller  (AT, PS/2)
  138. 0020-0027       8259A interrupt controller
  139. 0020-003F       8259A interrupt controller  (AT)
  140. 0040-005F       8253-5 programmable timers
  141.                 (note: 0041 was memory refresh in PCs. Not used in PS/2)
  142. 0060-0067       8255 peripheral interface
  143. 0060-006F       8042 keyboard controller  (AT)
  144. 0200-020F       game-control adapter
  145. 0210-0217       expansion box (PC, XT)
  146. 0278-027F       LPT3
  147. 02F8-02FF       COM2
  148. 0300-031F       prototype card
  149. 0320-032F       hard disk controller 
  150. 0378-037F       LPT2
  151. 03BC-03BF       LPT1
  152. 03D0-03DF       CGA, MCGA, VGA adapter control
  153. 03F0-03F7       floppy disk controller
  154. 03F8-03FF       COM1
  155.  
  156. note:   These are functions common across the IBM range. The PCjr, PC 
  157.         Convertible and PS/2 (both buses) have enhancements. In some cases, the
  158.         AT and PS/2 series ignore, duplicate, or reassign ports arbitrarily. If
  159.         your code incorporates specific port addresses for video or system board
  160.         control it would be wise to have your application determine the machine
  161.         type and video adapter and address the ports as required.
  162.  
  163.  
  164.  
  165.                    Reserved Memory Locations in the IBM PC
  166.  
  167. addr.  size            description
  168.  
  169. 000h-3FFh      DOS interrupt vector table
  170. 30:00h-        used as a stack area during POST and bootstrap routines. This
  171. 3F:FFh         stack area may be revectored by an application program.
  172.                The BIOS Data Area  addr. from 400h to 4FFh
  173. 40:00  word    COM1 port address |   These addresses are zeroed out in the
  174. 40:02  word    COM2 port address |   OS/2 DOS Compatibility Box if any of
  175. 40:04  word    COM3 port address |   the OS/2 COM??.SYS drivers are loaded.
  176. 40:06  word    COM4 port address |  
  177. 40:08  word    LPT1 port address
  178. 40:0A  word    LPT2 port address
  179. 40:0C  word    LPT3 port address
  180. 40:0E  word    LPT4 port address        (not valid in PS/2 machines)
  181. 40:0E  word    PS/2 pointer to 1k extended BIOS Data Area at top of RAM
  182. 40:10  word    equipment flag (see int 11h)
  183.                bits:
  184.                0        1 if floppy drive present (see bits 6&7)  0 if not
  185.                1        1 if 80x87 installed  (not valid in PCjr)
  186.                2,3      system board RAM   (not used on AT or PS/2)
  187.                         00      16k
  188.                         01      32k
  189.                         10      48k
  190.                         11      64k
  191.                4,5      initial video mode
  192.                         00      no video adapter
  193.                         01      40 column color  (PCjr)
  194.                         10      80 column color
  195.                         11      MDA
  196.                6,7      number of diskette drives
  197.                         00      1 drive
  198.                         01      2 drives
  199.                         10      3 drives
  200.                         11      4 drives
  201.                8        0       DMA present
  202.                         1       DMA not present (PCjr)
  203.                9,A,B    number of RS232 serial ports
  204.                C        game adapter  (joystick)
  205.                         0       no game adapter
  206.                         1       if game adapter
  207.                D        serial printer (PCjr only)
  208.                         0       no printer
  209.                         1       serial printer present
  210.                E,F      number of parallel printers installed
  211.        note 1) The IBM PC and AT store the settings of the system board
  212.                switches or CMOS RAM setup information (as obtained by the BIOS
  213.                in the Power-On Self Test (POST)) at addresses 40:10h and
  214.                40:13h. 00000001b indicates "on", 00000000b is "off".
  215.             2) CMOS RAM map, PC/AT:
  216.               offset               contents
  217.                 00h         Seconds
  218.                 01h         Second Alarm
  219.                 02h         Minutes
  220.                 03h         Minute Alarm
  221.                 04h         Hours
  222.                 05h         Hour Alarm
  223.                 06h         Day of the Week
  224.                 07h         Day of the Month
  225.                 08h         Month
  226.                 09h         Year
  227.                 0Ah         Status Register A
  228.                 0Bh         Status Register B
  229.                 0Ch         Status Register C
  230.                 0Dh         Status Register D
  231.                 0Eh         Diagnostic Status Byte
  232.                 0Fh         Shutdown Status Byte
  233.                 10h         Disk Drive Type for Drives A: and B:
  234.                             The drive-type bytes use bits 0:3 for the first
  235.                             drive and 4:7 for the other
  236.                             Disk drive types:
  237.                             00h         no drive present
  238.                             01h         double sided 360k
  239.                             02h         high capacity (1.2 meg)
  240.                             03h-0Fh     reserved
  241.                 11h         (AT):Reserved    (PS/2):drive type for hard disk C:
  242.                 12h         (PS/2):drive type for hard disk D:
  243.                             (AT, XT/286):hard disk type for drives C: and D:
  244.                             Format of drive-type entry for AT, XT/286:
  245.                             0       number of cyls in drive (0-1023 allowed)
  246.                             2       number of heads per drive (0-15 allowed)
  247.                             3       starting reduced write compensation (not
  248.                                     used on AT)
  249.                             5       starting cylinder for write compensation
  250.                             7       max. ECC data burst length, XT only
  251.                             8       control byte
  252.                                     Bit
  253.                                     7       disable disk-access retries
  254.                                     6       disable ECC retries
  255.                                     5-4     reserved, set to zero
  256.                                     3       more than 8 heads
  257.                                     2-0     drive option on XT (not used by AT)
  258.                             9       timeout value for XT (not used by AT)
  259.                             12      landing zone cylinder number
  260.                             14      number of sectors per track (default 17,
  261.                                     0-17 allowed)
  262.                 13h         Reserved
  263.                 14h         Equipment Byte (corresponds to sw. 1 on PC and XT)
  264.                 15h-16h     Base Memory Size      (low,high)
  265.                 17h-18h     Expansion Memory Size (low,high)
  266.                 19h-20h     Reserved
  267.                             (PS/2) POS information Model 50 (60 and 80 use a 2k
  268.                             CMOS RAM that is not accessible through software)
  269.                 21h-2Dh     Reserved (not checksumed)
  270.                 2Eh-2Fh     Checksum of Bytes 10 Through 20  (low,high)
  271.                 30h-31h     Exp. Memory Size as Det. by POST (low,high)
  272.                 32h         Date Century Byte
  273.                 33h         Information Flags (set during power-on)
  274.                 34h-3Fh     Reserved
  275.             3) The alarm function is used to drive the BIOS wait function (int
  276.                15h function 90h).
  277.             4) To access the configuration RAM write the byte address (00-3Fh)
  278.                you need to access to I/O port 70h, then access the data via I/O
  279.                port 71h.
  280.             5) CMOS RAM chip is a Motorola 146818
  281.             6) The equipment byte is used to determine the configuration for the
  282.                power-on diagnostics.
  283.             7) Bytes 00-0Dh are defined by the chip for timing functions, bytes
  284.                0Eh-3Fh  are defined by IBM.
  285. 40:12  byte    number of errors detected by infrared keyboard link (PCjr only)
  286. 40:13  word    availible memory size in Kbytes (less display RAM in PCjr)
  287.                this is the value returned by int 12h
  288. 40:17  byte    keyboard flag byte 0 (see int 9h)
  289.                bit 7  insert mode on      3  alt pressed
  290.                    6  capslock on         2  ctrl pressed
  291.                    5  numlock on          1  left shift pressed
  292.                    4  scrollock on        0  right shift pressed
  293. 40:18  byte    keyboard flag byte 1 (see int 9h)
  294.                bit 7  insert pressed      3  ctrl-numlock (pause) toggled
  295.                    6  capslock pressed    2  PCjr keyboard click active
  296.                    5  numlock pressed     1  PCjr ctrl-alt-capslock held
  297.                    4  scrollock pressed   0
  298. 40:19  byte    storage for alternate keypad entry (not normally used)
  299. 40:1A  word    pointer to keyboard buffer head character
  300. 40:1C  word    pointer to keyboard buffer tail character
  301. 40:1E  32bytes 16 2-byte entries for keyboard circular buffer, read by int 16h
  302. 40:3E  byte    drive seek status - if bit=0, next seek will recalibrate by
  303.                repositioning to Track 0.     
  304.                bit 3  drive D          bit 2  drive C
  305.                    1  drive B              0  drive A
  306. 40:3F  byte    diskette motor status
  307.                bit 7  1, write in progress 3  1, D: motor on (floppy 3)
  308.                    6                       2  1, C: motor on (floppy 2)
  309.                    5                       1  1, B: motor on
  310.                    4                       0  1, A: motor on
  311. 40:40  byte    motor off counter
  312.                starts at 37 and is decremented 1 by each system clock tick.
  313.                motor is shut off when count = 0.
  314. 40:41  byte    status of last diskette operation     where:
  315.                bit 7 timeout failure            bit 3 DMA overrun
  316.                    6 seek failure                   2 sector not found
  317.                    5 controller failure             1 address not found
  318.                    4 CRC failure                    0 bad command
  319. 40:42  7 bytes NEC status
  320. 40:49  byte    current CRT mode (hex value)
  321.                    00h 40x25 BW      (CGA)          01h 40x25 color   (CGA)
  322.                    02h 80x25 BW      (CGA)          03h 80x25 color   (CGA)
  323.                    04h 320x200 color (CGA)          05h 320x200 BW    (CGA)
  324.                    06h 640x200 BW    (CGA)          07h monochrome    (MDA)  
  325.                extended video modes (EGA/MCGA/VGA or other)
  326.                    08h lores,16 color               09h med res,16 color
  327.                    0Ah hires,4 color                0Bh n/a
  328.                    0Ch med res,16 color             0Dh hires,16 color   
  329.                    0Eh hires,4 color                0Fh hires,64 color 
  330. 40:4A  word    number of columns on screen, coded as hex number of columns
  331.                20 col = 14h  (video mode 8, low resolution 160x200 CGA graphics)
  332.                40 col = 28h
  333.                80 col = 46h
  334. 40:4C  word    screen buffer length in bytes
  335.                (number of bytes used per screen page, varies with video mode)
  336. 40:4E  word    current screen buffer starting offset (active page)
  337. 40:50  8 words cursor position pages 1-8
  338.                the first byte of each word gives the column (0-19, 39, or 79)
  339.                the second byte gives the row (0-24)
  340. 40:60  byte    end line for cursor   (normally 1)
  341. 40:61  byte    start line for cursor (normally 0)
  342. 40:62  byte    current video page being displayed  (0-7)
  343. 40:63  word    base port address of 6845 CRT controller or equivalent
  344.                for active display           3B4h=mono, 3D4h=color
  345. 40:65  byte    current setting of the CRT mode register
  346. 40:66  byte    current palette mask setting  (CGA)
  347. 40:67  5 bytes temporary storage for SS:SP during shutdown (cassette interface)
  348. 40:6C  word    timer counter low word
  349. 40:6E  word    timer counter high word
  350. 40:69  byte    HD_INSTALL (Columbia PCs) (not valid on most clone computers)
  351.                bit  0 = 0  8 inch external floppy drives
  352.                         1  5-1/4 external floppy drives
  353.                   1,2 =    highest drive address which int 13 will accept
  354.                            (since the floppy drives are assigned 0-3, subtract
  355.                            3 to obtain the number of hard disks installed)
  356.  
  357.                   4,5 =    # of hard disks connected to expansion controller
  358.                   6,7 =    # of hard disks on motherboard controller
  359.                            (if bit 6 or 7 = 1, no A: floppy is present and
  360.                            the maximum number of floppies from int 11 is 3)
  361. 40:70  byte    24 hour timer overflow 1 if timer went past midnight
  362.                it is reset to 0 each time it is read by int 1Ah
  363. 40:71  byte    BIOS break flag (bit 7 = 1 means break key hit)
  364. 40:72  word    reset flag (1234 = soft reset, memory check will be bypassed)
  365.                PCjr keeps 1234h here for softboot when a cartridge is installed
  366. 40:74  byte    status of last hard disk operation; PCjr special diskette control
  367. 40:75  byte    # of hard disks attached (0-2)    ; PCjr special diskette control
  368. 40:76  byte    hd control byte; temporary holding area for 6th param table entry
  369. 40:77  byte    port offset to current hd adapter ; PCjr special diskette control
  370. 40:78  4 bytes timeout value for LPT1,LPT2,LPT3,LPT4
  371. 40:7C  4 bytes timeout value for COM1,COM2,COM3,COM4 (0-FFh seconds, default 1) 
  372. 40:80  word    pointer to start of circular keyboard buffer, default 03:1E
  373. 40:82  word    pointer to end of circular keyboard buffer, default 03:3E
  374. 40:84  byte    rows on the screen (EGA only)
  375. 40:84  byte    PCjr interrupt flag; timer channel 0  (used by POST)
  376. 40:85  word    bytes per character (EGA only)
  377. 40:85  2 bytes (PCjr only) typamatic char to repeat
  378. 40:86  2 bytes (PCjr only) typamatic initial delay
  379. 40:87  byte    mode options (EGA only)
  380.                Bit 1   0 = EGA is connected to a color display
  381.                        1 = EGA is monochrome.
  382.                Bit 3   0 = EGA is the active display,
  383.                        1 = "other" display is active.
  384.                   Mode combinations:
  385.                   Bit3  Bit1     Meaning
  386.                     0     0   EGA is active display and is color
  387.                     0     1   EGA is active display and is monochrome
  388.                     1     0   EGA is not active, a mono card is active
  389.                     1     1   EGA is not active, a CGA is active
  390. 40:87  byte    (PCjr only) current Fn key code
  391. 40:88  byte    feature bit switches (EGA only) 0=on, 1=off
  392.                bit 3 = switch 4 
  393.                bit 2 = switch 3
  394.                bit 1 = switch 2
  395.                bit 0 = switch 1
  396. 40:88  byte    (PCjr only) special keyboard status byte
  397.                bit 7 function flag      3 typamatic (0=enable,1=disable)
  398.                    6 Fn-B break         2 typamatic speed (0=slow,1=fast)
  399.                    5 Fn pressed         1 extra delay bef.typamatic (0=enable)
  400.                    4 Fn lock            0 write char, typamatic delay elapsed
  401. 40:89  byte    PCjr, current value of 6845 reg 2 (horiz.synch) used by
  402.                ctrl-alt-cursor screen positioning routine in ROM
  403. 40:8A  byte    PCjrCRT/CPU Page Register Image, default 3Fh
  404. 40:8B  byte    last diskette data rate selected
  405. 40:8C  byte    hard disk status returned by controller
  406. 40:8D  byte    hard disk error returned by controller
  407. 40:8E  byte    hard disk interrupt (bit 7=working int)
  408. 40:90  4 bytes media state drive 0, 1, 2, 3
  409. 40:94  2 bytes track currently seeked to drive 0, 1
  410. 40:96  byte    keyboard flag byte 3 (see int 9h)
  411. 40:97  byte    keyboard flag byte 2 (see int 9h)
  412. 40:98  dword   pointer to users wait flag
  413. 40:9C  dword   users timeout value in microseconds
  414. 40:A0  byte    real time clock wait function in use
  415. 40:A1  byte    LAN A DMA channel flags
  416. 40:A2  2 bytes status LAN A 0,1
  417. 40:A4  dword   saved hard disk interrupt vector
  418. 40:A8  dword   EGA pointer to parameter table
  419. 40:B4  byte    keyboard NMI control flags (Convertible)
  420. 40:B5  dword   keyboard break pending flags (Convertible)
  421. 40:B9  byte    port 60 single byte queue (Convertible)
  422. 40:BA  byte    scan code of last key (Convertible)
  423. 40:BB  byte    pointer to NMI buffer head (Convertible)
  424. 40:BC  byte    pointer to NMI buffer tail (Convertible)
  425. 40:BD  16bytes NMI scan code buffer (Convertible)
  426. 40:CE  word    day counter (Convertible and after)
  427. to -04:8F               end of BIOS Data Area
  428. 40:90-40:EF             reserved by IBM
  429. 04:F0 16 bytes Intra-Application Communications Area (for use by applications
  430. 04:FF          to transfer data or parameters to each other)
  431.  
  432. 05:00  byte    DOS print screen status flag
  433.                         00h    not active or successful completion
  434.                         01h    print screen in progress
  435.                         0FFh   error during print screen operation
  436. 05:01          Used by BASIC
  437. 05:02-03       PCjr POST and diagnostics work area
  438. 05:04  byte    Single drive mode status byte
  439.                         00     logical drive A
  440.                         01     logical drive B
  441. 05:05-0E       PCjr POST and diagnostics work area
  442. 05:0F          BASIC: SHELL flag (set to 02h if there is a current SHELL)
  443. 05:10  word    BASIC: segment address storage (set with DEF SEG)
  444. 05:12  4 bytes BASIC: int 1Ch clock interrupt vector segment:offset storage
  445. 05:16  4 bytes BASIC: int 23h ctrl-break interrupt segment:offset storage
  446. 05:1A  4 bytes BASIC: int 24h disk error interrupt vector segment:offset storage
  447. 05:1B-1F       Used by BASIC for dynamic storage
  448. 05:20-21       Used by DOS for dynamic storage
  449. 05:22-2C       Used by DOS for diskette parameter table. See int 1Eh for values
  450. 05:30-33       Used by MODE command
  451. 05:34-FF       Unknown - Reserved for DOS
  452.  
  453.  
  454. At Absolute Addresses:
  455.  
  456. 0008:0047 IO.SYS or IBMBIO.COM IRET instruction. This is the dummy routine that
  457.           interrupts 01h, 03h, and 0Fh are initialized to during POST. 
  458. C000:001E EGA BIOS signature (the letters IBM)
  459. F000:FFF5 BIOS release date
  460. F000:FFFE PC model identification
  461.              date      model byte            submodel byte    revision
  462.            04/24/81     FF = PC-0 (16k)         --              --
  463.            10/19/81     FF = PC-1 (64k)         --              --
  464.            08/16/82     FF = PC, XT, XT/370     --              --
  465.                              (256k motherboard)
  466.            10/27/82     FF = PC, XT, XT/370     --              --
  467.                              (256k motherboard)
  468.            11/08/82     FE = XT, Portable PC    --              --
  469.                              XT/370, 3270PC
  470.            01/10/86     FB = XT                 00              01
  471.            01/10/86     FB = XT-2 (early)   
  472.            05/09/86     FB = XT-2 (640k)        00              02
  473.            06/01/83     FD = PCjr               --              --
  474.            01/10/84     FC = AT                 --              --
  475.            06/10/85     FC = AT                 00              01
  476.            11/15/85     FC = AT                 01              00
  477.            04/21/86     FC = XT/286             02              00
  478.            09/13/85     F9 = Convertible        00              00
  479.            09/02/86     FA = PS/2 Model 30      00              00
  480.            11/15/86     FC = AT, Enhanced 8mHz
  481.            02/13/87     FC = PS/2 Model 50      04              00
  482.            02/13/87     FC = PS/2 Model 60      05              00
  483.            1987         F8 = PS/2 Model 80      00              00
  484.                         2D = Compaq PC (4.77)   --              --
  485.                         9A = Compaq Plus (XT)   --              --
  486.  
  487.                   00FC 7531/2 Industrial AT
  488.              06FC 7552 Gearbox
  489.  
  490.  
  491.  
  492.  
  493.                   The IBM PC System Interrupts   (Overview)
  494.  
  495.  The interrupt table is stored in the very lowest location in memory, starting 
  496. at 0000:0000h. The locations are offset from segment 0, ie location 0000h has
  497. the address for int 0, etc. Each address is four bytes long and its location in
  498. memory can be found by multiplying the interrupt number by 4. For example, int
  499. 7 could be found by (7x4=28) or 1Bh (0000:001Bh).
  500.  These interrupt vectors normally point to ROM tables or are taken over by DOS 
  501. when an application is run. Some applications revector these interrupts to 
  502. their own code to change the way the system responds to the user.
  503.  
  504. Interrupt Address    Function
  505.  Number    (Hex)
  506.     0      00-03    CPU   Divide by Zero
  507.     1      04-07    CPU   Single Step
  508.     2      08-0B    CPU   Nonmaskable
  509.     3      0C-0F    CPU   Breakpoint
  510.     4      10-13    CPU   Overflow
  511.     5      14-17    BIOS  Print Screen
  512.     6      18-1B    hdw   Reserved
  513.     7      1C-1F    hdw   Reserved
  514.     8      20-23    hdw   Time of Day
  515.     9      24-27    hdw   Keyboard
  516.     A      28-2B    hdw   Reserved
  517.     B      2C-2F    hdw   Communications [8259]
  518.     C      30-33    hdw   Communications
  519.     D      34-37    hdw   Disk
  520.     E      38-3B    hdw   Diskette
  521.     F      3C-3F    hdw   Printer
  522.    10      40-43    BIOS  Video
  523.    11      44-47    BIOS  Equipment Check
  524.    12      48-4B    BIOS  Memory
  525.    13      4C-4F    BIOS  Diskette/Disk
  526.    14      50-53    BIOS  Serial Communications
  527.    15      54-57    BIOS  Cassette, System Services
  528.    16      58-5B    BIOS  Keyboard
  529.    17      5C-5F    BIOS  Parallel Printer
  530.    18      60-63    BIOS  Resident BASIC
  531.    19      64-67    BIOS  Bootstrap Loader
  532.    1A      68-6B    BIOS  Time of Day
  533.    1B      6C-6F    BIOS  Keyboard Break
  534.    1C      70-73    BIOS  Timer Tick
  535.    1D      74-77    BIOS  Video Initialization
  536.    1E      78-7B    BIOS  Diskette Parameters
  537.    1F      7C-7F    BIOS  Video Graphics Characters, second set
  538.    20      80-83    DOS   General Program Termination
  539.    21      84-87    DOS   DOS Services Function Request
  540.    22      88-8B    DOS   Called Program Termination Address
  541.    23      8C-8F    DOS   Control Break Termination Address
  542.    24      90-93    DOS   Critical Error Handler
  543.    25      94-97    DOS   Absolute Disk Read
  544.    26      98-9B    DOS   Absolute Disk Write
  545.    27      9C-9F    DOS   Terminate and Stay Resident
  546.    28-3F   A0-FF    DOS   Reserved for DOS
  547.    40-43   100-115  BIOS  Reserved for BIOS
  548.    44      116-119  BIOS  First 128 Graphics Characters
  549.    45-47   120-131  BIOS  Reserved for BIOS
  550.    48      132-135  BIOS  PCjr Cordless Keyboard Translation
  551.    49      136-139  BIOS  PCjr Non-Keyboard Scancode Translation Table
  552.    50-5F   140-17F  BIOS  Reserved for BIOS
  553.    60-67   180-19F  Reserved for User Software Interrupts
  554.    68-7F   1A0-1FF  Reserved by IBM
  555.    80-85   200-217  ROM BASIC
  556.    86-F0   218-3C3  Used by BASIC Interpreter When BASIC is Running
  557.    F1-FF   3C4-3FF  Reserved by IBM
  558.  
  559.  
  560.  For consistency in this volume, all locations and offsets are in hexadecimal 
  561. unless otherwise specified. All hex numbers are prefaced with a leading zero 
  562. if they begin with an alphabetic character, and are terminated with a 
  563. lowercase H (h). The formats vary according to common usage.
  564.  
  565.  
  566.                 The IBM-PC System Interrupts  (in detail)
  567.  
  568.  
  569. Interrupt  00h  Divide by Zero (processor error). Automatically called at end
  570. (0:0000h)       of DIV or IDIV operation that results in error. Normally set by
  571.                 DOS to display an error message and abort the program.
  572.  
  573.  
  574. Interrupt  01h  Single step - Taken after every instruction when CPU Trap Flag
  575. (0:0004h)       indicates single-step mode (bit 8 of FLAGS is 1). This is what
  576.                 makes the T command of DEBUG work for single stepping. Is not
  577.                 generated after MOV to segment register or POP of segment 
  578.                 register. (unless you have a very early 8088 with the microcode
  579.                 bug).
  580.  
  581.  
  582. Interrupt  02h  Non-maskable interrupt - Vector not disabled via CLI. Used by
  583. (0:0008h)       parity check routine in POST, 8087 coprocessor, PCjr infrared
  584.                 keyboard link.
  585.  
  586.  
  587. Interrupt  03h  Breakpoint - Taken when CPU executes the 1-byte int 3 (0CCh).
  588. (0:000Ch)       Generated by opcode 0CCh. Similar to 8080's RST instruction.
  589.                 Generally used to set breakpoints for DEBUG.
  590.  
  591.  
  592. Interrupt 04h  Divide overflow -  Generated by INTO instruction if OF flag is
  593. (0:0010h)      set. If flag is not set, INTO is effectively a NOP. Used to trap
  594.                any arithmetic errors when program is ready to handle them rather
  595.                than immediately when they occur.
  596.  
  597.  
  598. Interrupt  05h  Print Screen - service dumps the screen to the printer. Invoked
  599. (0:0014h)       by int 9 for shifted key 55 (PrtSc). Automatically called by 
  600.                 keyboard scan when PrtSc key is pressed. Normally executes 
  601.                 routine to print the screen, but may call any routine that can
  602.                 safely be executed from inside the keyboard scanner. Status and
  603.                 result byte are at address 0050:0000.
  604. entry   AH      05h
  605. return  absolute address 50:0   
  606.         00h     print screen has not been called, or upon return from a call 
  607.                 there were no errors.
  608.         01h     print screen is already in progress.
  609.         0FFh    error encountered during printing.
  610. note 1) Uses BIOS services to read the screen
  611.      2) Output is directed to LPT1
  612.      3) Revectored into GRAPHICS.COM if GRAPHICS.COM is loaded
  613.  
  614.  
  615. Interrupt  06h  Reserved by IBM
  616. (0:0018h)
  617.  
  618.  
  619. Interrupt  07h  Reserved by IBM
  620. (0:00C0h)
  621.  
  622.  
  623. Interrupt  08h  Timer - 55ms timer "tick" taken 18.2 times per second. Updates
  624. (0:0020h)  (IRQ0)  BIOS clock and turns off diskette drive motors after 2
  625.            seconds of inactivity. 
  626. entry   AH      08h
  627. return  absolute addresses:
  628.         40:6C   number of interrupts since power on (4 bytes)
  629.         40:70   number of days since power on (1 byte)
  630.         40:67   day counter on all products after AT
  631.         40:40   motor control count - gets decremented and shuts off diskette 
  632.                 motor if zero
  633. note    Int 1Ch invoked as a user interrupt.
  634.  
  635.  
  636. Interrupt  09h  Keyboard - taken whenever a key is pressed or released. 
  637. (0:0024h)  (IRQ1)  Stores characters/scan-codes in status at [0040:0017,18]
  638. entry   AH      09h
  639. return  at absolute memory addresses:
  640.         40:17   bit
  641.                 0       right shift key depressed
  642.                 1       left shift key depressed
  643.                 2       control key depressed
  644.                 3       alt key depressed
  645.                 4       ScrollLock state has been toggled
  646.                 5       NumLock state has been toggled
  647.                 6       CapsLock state has been toggled
  648.                 7       insert state is active
  649.         40:18   bit
  650.                 0       left control key depressed
  651.                 1       left alt key depressed
  652.                 2       SysReq key depressed
  653.                 3       Pause key has been toggled
  654.                 4       ScrollLock key is depressed
  655.                 5       NumLock key is depressed
  656.                 6       CapsLock key is depressed
  657.                 7       Insert key is depressed
  658.         40:96   bit
  659.                 0       last code was the E1h hidden code
  660.                 1       last code was the E0h hidden code
  661.                 2       right control key down
  662.                 3       right alt key down
  663.                 4       101 key Enhanced keyboard installed
  664.                 5       force NumLock if rd ID & kbx
  665.                 6       last character was first ID character
  666.                 7       doing a read ID (must be bit 0)
  667.         40:97   bit
  668.                 0       ScrollLock indicator
  669.                 1       NumLock indicator
  670.                 2       CapsLock indicator
  671.                 3       circus system indicator
  672.                 4       ACK received
  673.                 5       resend received flag
  674.                 6       mode indicator update
  675.                 7       keyboard transmit error flag
  676.         40:1E   keyboard buffer (20h bytes)
  677.         40:1C   buffer tail pointer
  678.         40:72   1234h if ctrl-alt-del pressed on keyboard
  679.      AL   scan code
  680. note 1) Int 05h invoked if PrtSc key pressed
  681.      2) Int 1Bh invoked if Ctrl-Break key sequence pressed
  682.      3) Int 15h, AH=85h invoked on AT and after if SysReq key is pressed
  683.      4) Int 15h, AH=4Fh invoked on machines after AT
  684.  
  685.  
  686. Interrupt  0Ah  EGA Vertical Retrace
  687. (0:0028h)  (IRQ2)  used by EGA vertical retrace, hard disk
  688.  
  689.  
  690. Interrupt  0Bh  Communications Controller (serial port) hdw. entry
  691. (0:002Ch)  (IRQ3)  Serial Port 2 (com2)
  692. note    IRQ 3 may be used by SDLC (synchronous data-link control) or 
  693.         bisynchronous communications cards instead of a serial port.
  694.  
  695.  
  696. Interrupt  0Ch  Communications Controller (serial port) hdw. entry
  697. (0:0030h)  (IRQ4)  Serial Port 1 (com1)
  698. note    IRQ 4 may be used by SDLC (synchronous data-link control) or 
  699.         bisynchronous communications cards instead of a serial port.
  700.                                         
  701.  
  702. Interrupt  0Dh  Alternate Printer, PC/AT 80287
  703. (0:0034h)  (IRQ5)  used by hard disk, 60 Hz RAM refresh, LPT2 on AT, XT/286,
  704.             and PS/2, dummy CRT vertical retrace on PCjr
  705.  
  706.  
  707. Interrupt  0Eh  Diskette - indicates that a seek is in progress
  708. (0:0038h)  (IRQ6)  (sets bit 8 of 40:3E)
  709.  
  710.  
  711. Interrupt  0Fh  Reserved by IBM
  712. (0:003Ch)  (IRQ7)  IRQ7 used by PPI interrupt (LPT1, LPT2)
  713.  
  714.